import request from '@/utils/request'
const api_name = '/eduservice/'
export default {
    getNestedTreeList(courseId) {
        return request({
            url: `${api_name}/list/${courseId}`,
            method: 'get'
        })
    },
    removeById(id) {
        return request({
            url: `${api_name}/delete/${id}`,
            method: 'delete'
        })
    },
    save(chapter) {
        return request({
            url: `${api_name}/add`,
            method: 'post',
            data: chapter
        })
    },
    getById(id) {
        return request({
            url: `${api_name}/search/${id}`,
            method: 'get'
        })
    },
    updateById(chapter) {
        return request({
            url: `${api_name}/update/${chapter.id}`,
            method: 'put',
            data: chapter
        })
    },
    previous() {
        console.log('previous')
        this.$router.push({ path: '/edu/course/info/' + this.courseId })
    },
    next() {
        console.log('next')
        this.$router.push({ path: '/edu/course/publish/' + this.courseId })
    }
}